package create.singleton;

/**
 * 多线程环境下双重检查实现高效单例
 * @author thinkpad
 *
 */
public class MultipleThreadSingleton {
	private static volatile MultipleThreadSingleton instance = null;

	private MultipleThreadSingleton() {
	}

	public static MultipleThreadSingleton getInstance() {
		if (instance == null) {
			synchronized (MultipleThreadSingleton.class) {
				if (instance == null) {
					instance = new MultipleThreadSingleton();
				}
			}
		}
		return instance;
	}
}
